<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>H+ 后台主题UI框架 - Bootstrap3 Markdown编辑器</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link href="../../static/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="../../static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="../../static/css/animate.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../../static/css/plugins/markdown/bootstrap-markdown.min.css" />
    <link href="../../static/css/style.css?v=4.0.0" rel="stylesheet"><base target="_blank">
    <script src="../../static/js/commonrequest.js"></script>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-lg-5">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>反向校验json</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_editors.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                        <pre id="toastrOptions" contenteditable="" name="content" data-provide="markdown" rows="25">
{
    "pathological_number":"P20-3937",
    "organization_id":"42500373300",
    "upload_file":[
        {
            "document_type":"ExamRequest",
            "document_count":0
        },
        {
            "document_type":"InformedConsent",
            "document_count":0
        },{
            "document_type":"ExamResult",
            "document_count":0
        },
        {
            "document_type":"ExamGeneral",
            "document_count":0
        },{
            "document_type":"ExamImage",
            "document_count":4
        },{
            "document_type":"ExamImageROI",
            "document_count":1
        }
    ]
}
                        </pre>
                    <div class="clearfix"></div>
                    <br>
                    <div class="form-group ">
                        <div class="col-sm-12 col-sm-offset-4">
                            <button class="btn btn-primary" id="submit1">提交</button>
                            <button class="btn btn-white" id="reset" type="submit">重置</button>
                        </div>
                    </div>
                    <br>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox-content">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>接口返回信息</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="dropdown-toggle" data-toggle="dropdown" href="form_editors.html#">
                                <i class="fa fa-wrench"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="form-group ">
                            <div class="col-sm-12 col-sm-offset-4">
                                <button class="btn btn-white" id="clear2" type="submit">清空</button>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <div class="row m-t-lg">
                            <div class="col-lg-12">
                                <pre id="toastrOptions2" class="p-m"></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../../static/js/jquery.min.js?v=2.1.4"></script>
<script src="../../static/js/bootstrap.min.js?v=3.3.5"></script>
<script src="../../static/js/content.min.js?v=1.0.0"></script>
<script type="text/javascript" src="../../static/js/plugins/markdown/markdown.js"></script>
<script type="text/javascript" src="../../static/js/plugins/markdown/to-markdown.js"></script>
<script type="text/javascript" src="../../static/js/plugins/markdown/bootstrap-markdown.js"></script>
<script type="text/javascript" src="../../static/js/plugins/markdown/bootstrap-markdown.zh.js"></script>
<script src="../../static/js/jquery-ui-1.10.4.min.js"></script>
<script src="../../static/js/plugins/beautifyhtml/beautifyhtml.js"></script>
<script src="../../static/js/plugins/validate/jquery.validate.min.js"></script>
<script src="../../static/js/plugins/validate/messages_zh.min.js"></script>
<script src="../../static/js/demo/form-validate-demo.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        var json=sessionStorage.getItem("reqJson");
        if(json!=null){
            json= JSON.parse(json);
            var reqfilecheck = JSON.stringify(json, null, 2);//将字符串转换成json对象
            document.getElementById('toastrOptions').innerText= reqfilecheck;
        }
    });
    $(function(){
        $("#submit1").click(function(){
            document.getElementById('toastrOptions2').innerText="";
            var toastrOptions =document.getElementById("toastrOptions").innerHTML;
            var toastrOptions=toastrOptions.replace(/(<br[^>]*>|\s*)/g,'');
            $.ajax({
                type: "POST",
                url: '/langjiaInterface/localfilecheck',
                data: {"toastrOptions":toastrOptions},
                dataType:'json',
                beforeSend: function (XMLHttpRequest) {
                    XMLHttpRequest.setRequestHeader("Authorization", handleLocalStorage('get', 'Authorization'));
                },
                success: function(data){
                    var respfilecheck=data;
                    respfilecheck = JSON.stringify(respfilecheck, null, 2);//将字符串转换成json对象
                    document.getElementById('toastrOptions2').innerText= respfilecheck;
                },
                error:function(){
                    alert("取数失败！");
                }
            });
        });
        $('#clear2').click(function(){
            $('#toastrOptions2').html("");
        });
        $('#clear3').click(function(){
            $('#toastrOptions3').html("");
        });

        $('#reset').click(function(){
            $('#toastrOptions').html("" +
                "{\n" +
                "    \"pathological_number\":\"P20-3937\",\n" +
                "    \"organization_id\":\"42500373300\",\n" +
                "    \"upload_file\":[\n" +
                "        {\n" +
                "            \"document_type\":\"ExamRequest\",\n" +
                "            \"document_count\":0\n" +
                "        },\n" +
                "        {\n" +
                "            \"document_type\":\"InformedConsent\",\n" +
                "            \"document_count\":0\n" +
                "        },{\n" +
                "            \"document_type\":\"ExamResult\",\n" +
                "            \"document_count\":0\n" +
                "        },\n" +
                "        {\n" +
                "            \"document_type\":\"ExamGeneral\",\n" +
                "            \"document_count\":0\n" +
                "        },{\n" +
                "            \"document_type\":\"ExamImage\",\n" +
                "            \"document_count\":4\n" +
                "        },{\n" +
                "            \"document_type\":\"ExamImageROI\",\n" +
                "            \"document_count\":1\n" +
                "        }\n" +
                "    ]\n" +
                "}\n" +
                "                        ");
            $('#toastrOptions2').html("");
        });

    });
</script>
</body>

</html>